package com.billdowney.security.strategy;

import java.io.IOException;

import org.springframework.security.web.session.SessionInformationExpiredEvent;
import org.springframework.security.web.session.SessionInformationExpiredStrategy;
import org.springframework.stereotype.Component;

import com.billdowney.util.http.HttpIOUtil;
import com.billdowney.util.return_type.ReturnData;

/**
 * spring security session过期处理
 * 
 * @author 超级小富翁 - BillDowney
 * @date 2019年3月13日 下午11:52:53
 */
@Component
public class SessionInformationExpiredStrategyImpl implements SessionInformationExpiredStrategy {

	@Override
	public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException {
		HttpIOUtil.outJsonData(event.getResponse(), new ReturnData("10004"));
	}

}
